﻿using System;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
using CE.Database;
using CE.Security;

/// <summary>
/// Summary description for ErrorLogDB
/// </summary>

namespace CE.Log
{
    public class ErrorLogDB
    {
        public ErrorLogDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(ErrorLog errorlog)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocProposalErrorLogInsertUpdateSingleItem";
            SortedList _sPara = new SortedList();
            #region Parameter
            _sPara.Add("@LogId", errorlog.LogId);
            _sPara.Add("@ProposalId", errorlog.ProposalId);
            _sPara.Add("@RefId", errorlog.RefId);
            _sPara.Add("@ProviderCompanyId", errorlog.ProviderCompanyId);
            _sPara.Add("@ProductType", errorlog.ProductType);
            _sPara.Add("@OrderNo", errorlog.OrderNo);
            _sPara.Add("@ErrorMessage", errorlog.ErrorMessage);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);
            return _result;
        }
    }
}
